package getData.GetData;

public class GetDataAdapter implements  GetData{

   public  Worker work;

   public GetDataAdapter(String audioType){
      if(audioType.equalsIgnoreCase("DB") ){
         work = new DBer();
      } else if (audioType.equalsIgnoreCase("Cache")){
         work = new Cacher();
      }
   }

   //命令工作                          需要查询的数据
   public String commandWork(String worker, String data) {
      if(worker.equalsIgnoreCase("DB")){
         return  work.getDataFromDB("DB");
      }else if(worker.equalsIgnoreCase("Cache")){
         return work.getDataFromCache("Cache");
      }
      return null;
   }




}
